package com.canaan.business.service.inOutStock;

import com.canaan.business.domain.inOutStock.WmsInStockOrder;
import com.canaan.business.domain.storehouse.StockCheckDiff;
import com.canaan.business.domain.vo.StockDetailProductVo;
import com.canaan.business.domain.vo.WmsInStockOrderVo;

import java.util.List;

/**
 * 入库单Service接口
 *
 * @author ruoyi
 * @date 2022-12-20
 */
public interface IWmsInStockOrderService
{
    /**
     * 查询入库单
     *
     * @param id 入库单主键
     * @return 入库单
     */
    public WmsInStockOrder selectWmsInStockOrderById(Long id);
    /**
     * 查询入库单
     *
     * @param no 入库单编号
     * @return 入库单
     */
    public WmsInStockOrder selectWmsInStockOrderByNo(String no);

    /**
     * 查询入库单列表
     *
     * @param wmsInStockOrder 入库单
     * @return 入库单集合
     */
    public List<WmsInStockOrder> selectWmsInStockOrderList(WmsInStockOrder wmsInStockOrder);

    /**
     * 新增入库单
     *
     * @param wmsInStockOrder 入库单
     * @return 结果
     */
    public int insertWmsInStockOrder(WmsInStockOrder wmsInStockOrder);

    /**
     * 修改入库单
     *
     * @param wmsInStockOrder 入库单
     * @return 结果
     */
    public int updateWmsInStockOrder(WmsInStockOrder wmsInStockOrder);

    /**
     * 入库单取消
     *
     * @param wmsInStockOrder 入库单
     * @return 结果
     */
    public int cancel(WmsInStockOrder wmsInStockOrder);

    /**
     * 批量删除入库单
     *
     * @param ids 需要删除的入库单主键集合
     * @return 结果
     */
    public int deleteWmsInStockOrderByIds(Long[] ids);

    /**
     * 删除入库单信息
     *
     * @param id 入库单主键
     * @return 结果
     */
    public int deleteWmsInStockOrderById(Long id);

    /**
     * 导出列表查询
     * @param entity    参数
     * @return 导出列表
     */
    List<WmsInStockOrderVo> exportList(WmsInStockOrder entity);

    WmsInStockOrder selectWmsInStockOrderByRelOrderNo(String no, Integer code);

    void initBillStockOrder(String relOrderNo, Integer orderType,String CustomerNo, List<StockDetailProductVo> stockDetailProductVos);

    WmsInStockOrder directInStock(String relOrderNo, Integer orderType, List<StockCheckDiff> stockDetailProductVos, String remark);

    /**
     * 删除入库单信息
     *
     * @param relOrderNos 来源单据编号
     * @param orderType 对应的入库单类型
     * @return 结果
     */
    public int deleteWmsInStockOrderByRelOrderNosAndType(List<String> relOrderNos, Integer orderType);


    /**
     * 获取今日完成数
     * @param storehouseNo
     * @return
     */
    Integer getTodayCompletedNum(String storehouseNo);

    /**
     * 获取待入库数
     * @param storehouseNo
     * @return
     */
    Integer getWaitInStockNum(String storehouseNo);
}
